t0 = int(input())
t1 = int(input())
ans=2
cut=t0-t1
while cut>0:
    ans+=1
    temp=cut
    t0=t1
    t1=temp
    cut=t0-t1
print(ans)